package com.gongj.resilience4j.controller;

import com.gongj.resilience4j.client.UserClient;
import com.gongj.resilience4j.service.resilience4jServcie;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @program: cloudlx
 * @description:
 * @author: gongj
 * @Description: TODO
 * @create: 2020-06-19 23:58
 **/
@RestController
public class resilience4jController {

    @Autowired
    UserClient userClient;

    @Autowired
    resilience4jServcie resilience;

    @GetMapping
    public String test1(){
        String user = resilience.getUser();
        System.out.println(user);
        return user;
    }

    @GetMapping("/getUser")
    public void getUser(){
        String user = userClient.getUser();
        System.out.println(user);
    }
}
